import { Button, Text, View } from '@ray-js/ray';
import { DialogInstance, Dialog } from '@ray-js/smart-ui'; // 导入 SmartUI 提供的导航栏和按钮组件
import React from 'react';
import Styles from './index.module.less'; // 引入模块化样式
export default function Test3() {
    const open = () => {
        DialogInstance.confirm({
            selector: '#dialog',
            title: '提示',
            message: '请确认定时是否保存',
            confirmButtonText: '保存',
            cancelButtonText: '取消',
            customStyle: { backgroundColor: '#353535', color: '#353535' },
        })
            .then(() => {
                // 确认
            })
            .catch(() => {
                // 取消
            });
    };

    return (
        <View style={{ width: '100%', height: '100%' }}>
            <Button id="button" onClick={e => open()}>显示对话框</Button>
            <Dialog
                customStyle={{ backgroundColor: '#00ff00' }}
                id="dialog"
                title='提示'
                message='请确认定时是否保存'
                customClass={Styles.dialog}
            />
        </View>
    )
}